using System;
using System.Collections.Generic;
using System.Text;

namespace OurMediaPlayer.Model
{
    class Utils
    {
        public static string SecondsToHHMMSS(double seconds)
        {
            double mySeconds = seconds;

            int myHours = (int)(mySeconds / 3600); //3600 Seconds in 1 hour 
            mySeconds %= 3600;

            int myMinutes = (int)(mySeconds / 60); //60 Seconds in a minute 
            mySeconds %= 60;

            string mySec = ((int)mySeconds).ToString();
            string myMin = myMinutes.ToString();
            string myHou = myHours.ToString();

            if (myHours < 10) { myHou = myHou.Insert(0, "0"); }
            if (myMinutes < 10) { myMin = myMin.Insert(0, "0"); }
            if (mySeconds < 10) { mySec = mySec.Insert(0, "0"); }

            return myHou + ":" + myMin + ":" + mySec;
        }
    }
}
